import that from '../main.js'

const webDirective = (el, value) => {
    const hasPermis = []
    const permissionList = that.$store.state.permissionList
    const targetIndex = permissionList.findIndex(i => i.permCode === "production.management")
    const lastIndex = permissionList[targetIndex].submenu.findIndex(i => i.permCode === "project")
    const filtrateConfig = permissionList[targetIndex].submenu[lastIndex].filtrateConfig //获取按钮权限数组
    filtrateConfig.forEach(i => {
        if(i.blPerm) hasPermis.push(i.permCode) 
    })
    if(!(hasPermis.indexOf(value) != -1)) el.remove()   //未包含   移除
}


export default webDirective